home *** CD-ROM | disk | FTP | other *** search
- u
-
- Creating a Commodore 8-bit Machine
- Code programming environment for
- Windows
- By Paul 'Trooper'Green
- ----------
- Windows
- This document is for a Windows prog-
- ramming environment, as I know nothing
- about Linux or Mac environments I would
- urge readers to send in setups for
- these machines to address the balance.
-
- DOWNLOAD
- First you will need to download all
- these files, & save them on your
- machine. When you choose to save them
- save them to your C:\ Drive, the root
- of your hard disk (you can always move
- the downloads later) mainly because
- they are easier to find, work with &
- we will all have the files in the same
- place so we both know where to find
- them.
-
- C64asmv
- First you will need c64asmv1.1a this
- is a windows dos program, the program
- converts the .txt files (or .src or
- .asm) files into a .prg (or .p00) or
- the actual executable files so;
- download the application from
- http://tothb.ehc.hu/software/
- index.html#c64asm
-
- & save it your machine.
-
- Emulator
- You'll also need an emulator (as
- getting things on a real C64 is a bit
- hard, although it can be done but for
- this example we will use emulation) I
- use WinVice (but there are other
- emulators such as CCS & HOX) for
- this document we will assume you are
- going to use Winvice. First download
- the application from
- http://www.viceteam.org/#download
-
- & choose the link that says.. Binary
- for MS-Windows 32bit
- (Pentium-optimized):
- WinVICE-2.0.zip.
-
- EDITOR
- The you need an editor, you could use
- notepad.exe from windows, but there is
- a free text editor (as you don't want
- the files being saved with any
- unnecessary characters, notepad has
- been known to add strange characters'
- to plain text files) called Crimson
- Editor. You can download the latest
- version from their website
- http://www.crimsoneditor.com/
-
- (look under the contents bar, there is
- a download (2nd down), from there, you
- want to get the Crimson Editor 3.70
- Release (Sep. 22, 2004, 1224KB)
- from either of the links then save the
- executable to your hard disk.
-
- Ok, as was previously stated, we'll
- assume you have saved the files to
- "C:\" for everything as it makes life
- easier to follow.
-
- The c64asm1a.zip file you've downloaded
- I want you to unpack/un-archarchive
- this file so you end up with a folder
- in your C:\ Drive that is called
- c64asm1a & contains all the files from
- the within the .zip file.
-
- Then double click & install the
- Crimson Editor, you will receive an
- 'error message' on the first running
- the application, but it explains that
- when you do run it...when that has
- run, just close it for now...
-
- The WinVICE-2.0.zip you've downloaded
- you need to unpack/unarcharchive so
- you end up with a folder in your C:\
- Drive which is called WinVICE-2.0 &
- contains all the files from the .zip
- file (you will notice within that
- folder, depending on how you choose to
- unpack It, you might have a WinVICE-2.0
- folder in there too, now this is your
- call, I go into that folder, & move
- everything inside that to the one
- above, just seems to be a bit tidier)
-
- Right, when you have got Winvice
- installed/unpacked you can then run
- the application. It doesn't create a
- shortcut as there is no install, but
- you will find a file called x64.exe,
- located within the Winvice folder,
- that is the application to double-
- click to get the emulator running.
- Once the Emulator is running standard
- PRG & d64 files, will work with
- using windows drag & drop, but you
- won't be able to play them as you
- haven't got a joystick plugged in
- (technically). Go to it's settings &
- change anything you need to do, the
- main one is SettingsJoystick Settings,
- and you can setup a key map or choose
- a preset (or if you have one, use your
- own joystick in the machine)...
-
- Also for your ease, is to create a
- folder in the root of C:\ called
- "Source"... then if you look at the
- picture you will see my setup & how
- I have my area laid out for ease.
-
- New we need to get Crismon editor to
- Communicate with C64ASM, the thing to
- remember is C64asm is a DOS program,
- so any files need to be 8 chars & an
- extension, for example you could call
- something source1.src, then any
- changes could become source2.src, etc,
- etc.
-
- Ok, first we need the Crimson Spec
- Files.zip download this file from here
- http://www.slor.net/a8/6502spec.zip
- and save it to you desktop (if you
- wish to keep hold of this file in-case
- you do a re-install then save it
- elsewhere like on the root of your c:\
- drive) & when you have saved the
- file you need to unzip it & you'll
- end up with two files called.
-
- 6502.key
- 6502.spc
-
- these are just pure text files, but
- with the extension so crimson will
- understand them as configuration or
- syntax files.
-
- OK, so where do these files go? If
- you've installed Crimson into it's
- default location then you will find a
- folder called "C:\Program
- Files\Crimson Editor" within that
- folder there is a folder called 'spec'
- copy & paste (or cut & paste, it's
- your call) the two files into that
- folder....Then you can close that
- folder & open up Crimson Editor.
- Then it is time to set up Crimson.
-
- In the menus, go to 'Tools' & the
- Conf. User Tools
-
- this will open up the preferences
-
- Click on Syntax Type (as shown in the
- example), then scroll down to the
- first 'Empty' location & click on
- it.
-
- Now within the Description type C64
- (or whatever you want, but what you
- type there, displays on the menu so
- something descriptive would be more of
- an advantage) then click on the Browse
- (the 3 dots) to the right of Lang
- Spec, this will open a file browser.
- Now we need to look for the 6502.spc
- file, click on it & press the open
- button, then below is the keywords, do
- the same again, but this time you are
- looking for the 6502.key & press on
- the open button you should end up like
- this
-
- DescriptionC64
- Lang Spec6502.spc
- Keywords6502.key
-
- Now, if you click on the C64 in the
- Syntax Type box, which is now there
- because you typed it into the
- 'Description', it will highlight, &
- you can now click the up arrow &
- move the 'c64' to the top, as it will
- be quicker in the menu selection
- because it will appear as the first
- item in the menu list.
-
- Then you can click Ok, now when you go
- back to the menus, you'll see a C64
- choice under, Document - Syntax Type,
- you then click on C64 (the only thing
- I don't personally like about Crimson,
- it that the application doesn't
- remember what you've clicked on, if
- you close it down)
-
- Now if you type any text or syntax
- that pertains to the C64, it will
- change colour. If for some reason the
- text doesn't change colour you've
- probably just opened Crimson, & the
- editor has forgotten you like the C64
- syntax, reslect the c64 from the
- syntax list.
-
- So that bit sorts out the Syntax Text.
-
- The next part we will get crimson
- editor to communicate with C64asm.
-
- Open up Crimson Editor, & in the
- menus go to 'Tools' & the Conf. User
- Tools. This will open up the
- preferences. The default when the box
- opens is 'User Tools' this is ok, as
- this is what we want to change..
-
- Click on the first "-Empty-" so it is
- highlighted. And then in "Menu Text"
- you can type 'Compile with C64Asm'.
- Then in the 'Command' box you will
- click the three dots & you will be
- pointing it to the C64ASM.EXE file,
- (where ever you chose to save it &
- unzip it.)
-
- Just to the right of 'Argument' there
- is an arrow, click this, & choose
- 'File Name' & then below that, there
- is an 'Initial Dir.' You want to click
- the arrow to the right of that &
- choose 'File Directory'
-
- Below all that, you will have some
- tick boxes, Untick the 'Close on exit'
- other wise if there is an error during
- the compile you won't be able to see
- it as the CMD window will close too
- quickly.
-
- The 'Save before execute' is your
- choice, I have it turned on, as I want
- the program to save the file before it
- sends it to C64asm, or you'll have to
- manually save & then compile your
- file.
-
- Also, Hot Key is your Choice! I've got
- mine setup up, so I just press CTRL +
- ALT + Z, this saves me going into the
- menus.
-
- So to set this up, first click on the
- box to the right of the wording 'Hot
- Key' & actually press the keys you
- want for the shortcut.
-
- So, apart from the Location of your
- C64ASM which will display a real
- directory path in yours, it should
- look pretty much like you see in
- picture
-
- Then click ok.....
-
- Ok, in theory that has now set up
- Crimson to talk to C64ASM. One point
- I'll tell you now, with C64ASM being
- DOS it doesn't like being stored in a
- folder that has spaces in the name or
- in the folder before, etc. So it is
- best staying in the ROOT of a Hard
- Drive normally drive c:\.
-
- So, we should try to do a test compile
- ensuring everything is working ok.
-
- Right then you should have a blank
- Crimson Editor (if not choose
- File/New, so you end up with a Text1.
- Then type at the top (or copy &
- paste from this document)
-
- * = $2000 <--- copy or type into
- Crimson
-
- ;^^^- help on this command i.e. * = is
- in the C64ASM help file, basically it
- means your telling the compiler where
- you want the following code to compile
- too, $2000 is 8192, so on the C64
- you'd type SYS8192 You don't have to
- type this into Crimson though this
- would be used to RUN the program from
- BASIC
- Next type the following lines
-
- lda #$00
- sta $d020
- rts
-
- Right at the moment the source is
- called 'Text1' & should have a red
- dot by it to say it isn't saved, so
- right click on the 'Text1' & choose
- 'Save As' & save it in the folder
- for your source that you created
- previously. Call the filename test.src
- for now. (again you can call it what
- you want, but 8 chars & an extension
- is all you can go up to.)
-
- Now the Dot will go green, to say it
- has saved. Now either hit the menu
- options (under tools) , or if you set
- up a shortcut key command press it,
- but you want to be trying to compile
- the program you've just done. You
- should get a Command Box pop up, with
- something that looks like...
-
- C64ASM v1.1a - C64 (6510) Assembler
- Copyright (c) 1993-2001 by Balint Toth
-
- Assembling TEST.SRC
- TEST.PRG created from $2000 to $2005
- Press any key to exit
-
- you can now press any key, or hit the
- x to close that command prompt, if you
- look in your source folder a file
- called TEST.PRG will have been
- created. (Now technically without
- setting up crimson to auto execute
- into WinVice, you can just open up
- Winvice & drag & drop the .prg
- into Winvice using windows drag &
- drop, but & there is always a but,
- why? I hear you cry, well try it &
- see what happens....
-
- All you will get is...
-
-
- **** COMMODORE 64 BASIC V2 ****
-
- 64K RAM SYSTEM 38911 BASIC BYTES FREE
-
- READY.
- LOAD"TEST.PRG",8,1:
-
- SEARCHING FOR TEST.PRG
- LOADING
- READY.
- RUN
-
- READY.
-
-
- Technically it HAS worked, but the
- machine as you will remember uses the
- RUN to tell it what to do, & we
- didn't tell it in the source. Just
- type (in WinVice) SYS8192 & press
- return, & if you have done
- everything right, you should see the
- border turn black. If you do see that,
- then congratulations you have
- successfully typed up & compiled a
- C64 program in Machine Code & got it
- to run on the C64.
-
- This is the bit where we will get
- Crismon to Comminucate with WinVice
-
- Ok then, Open up Crimson Editor. And
- In the menu, go to 'Tools' & then
- Conf.User Tools. This will open up the
- preferences. The default when the box
- opens is 'User Tools' this is ok, as
- this is what we want to change....
-
- Click on the next "-Empty-" so that it
- is highlighted, & in "Menu Text" you
- can type 'Execute with WinVice' Then
- in the 'Command' box you will click
- the three dots & you will be
- pointing it to the X64.exe file,
- where-ever you chose to save it &
- unzip it.
-
- Now to the right of 'Argument' there
- is an arrow, click it, & choose
- 'File Title' & then move back into
- the box, & add ".PRG" at the end.
- Then below that item, there is an
- 'Initial Dir.' you want to click the
- arrow to the right of that & choose
- 'File Directory'. Below all that, you
- will have some tick boxes, tick the
- 'Close on exit'
-
- The 'Save before execute' is your
- choice, I have it turned on, as I want
- the program to save the file before it
- sends the file to C64asm, or you'll
- have to manually save & then compile
- your file.
-
- Also, Hot Key again is your Choice,
- I've got mine setup up, so I press
- CTRL + ALT + X, saves me going into
- the menus. To set up the hotkey, click
- on the box to the right of the wording
- 'Hot Key' & actually press the keys
- you want to use for the shortcut.
-
- So, apart from the Location of your
- WinVice which will display a real
- directory path in yours, it should
- look pretty much like you see here
-
- Then click ok
-
- Then you need to try to the compile
- and then run, so load the source code
- we used back up, try compiling again,
- and if you get no errors, then choose
- "Execute in WinVice" & see what
- happens..
-
- Don't forget you'll need to type
- SYS8192 again, you now have a Windows
- Compiling environment for your
- Assemble applications.
-
- ===
-
-